package com.netcracker.studportal.server.model;

public enum UserType {
	STUDENT("student"),
	PROFESSOR("professor"),
	ADMIN("admin"),
	UNKNOWN("unknown");
	
	private String type;
	private UserType(String type) {
		this.type = type;
	}
	
	public String getType() {
		return this.type;
	}
	
	public static UserType parse(String type) {
		for (UserType userType : UserType.values()) {
			if (userType.type.equalsIgnoreCase(type)) {
				return userType;
			}
		}
		
		return UNKNOWN;
	}
}
